1. Field of the Invention
The present invention relates to an image processing apparatus, and, more particularly, to an image processing apparatus that displays paths indicated in pickup images which were chronologically picked up, and an image processing method therefor, and a program that causes a computer to execute the image processing method.
2. Description of the Related Art
As a method for generating an image that indicates paths of a moving object by using pickup images (hereinafter, referred to as “frame images”) which were chronologically picked up, for example, a method for performing compositing by simply superimposing frame images on one another is considered. By using this simple method, the larger the number of frames, the lower the contribution ratio of one frame to a composition result. Accordingly, there is a problem that the color of paths of a moving object becomes light. For example, supposing that five frame images are provided as shown in parts (a) to (e) of FIG. 7, when compositing is simply performed, the contribution ratio of pixels to a composition result becomes 20%. Compositing is performed with the ratio between a moving object and a background that is 20% : 80% for pixel positions which a moving object crosses over. Thus, the color of paths of the moving object becomes light as shown in FIG. 8C.
In contrast, as a method obtained by making improvements to the simple compositing, a method is proposed, in which frame images are extracted from image data, in which weights are assigned to pixels in accordance with brightness values, and in which compositing is performed by combining the pixels having the weights with one another to obtain one still image (for example, see Japanese Unexamined Patent Application Publication No. 10-290450 (FIG. 1)). In this technique in the related art, regarding pixels that are provided at the same pixel position in the frame images, when pixels have brightness values whose distances from the average of brightness values are longer than the variance of brightness values, high weights are assigned to the pixels. When pixels having brightness values whose distances from the average of brightness values are shorter than the variance of brightness values, low weights are assigned to the pixels. Then, compositing is performed by combining the pixels having the weights with one another. A pixel that is provided at the same pixel position in an output image is output as a result of compositing. In this manner, in a composition image, weights that are used for a moving object are higher than those that are used for a background, and the color of paths of the moving object is darker than that of paths of the moving object that were obtained using the simple compositing method.
Furthermore, a method is proposed, in which a moving object is extracted, and in which compositing is performed for paths of the moving object by tracking the moving object (for example, see Japanese Unexamined Patent Application Publication No. 2005-123824 (FIG. 1)). In this technique in the related art, when a moving object is not tracked, data on the moving object is interpolated using characteristic values or positions of the moving object that were obtained at times when the moving object was successfully tracked, thereby increasing the accuracy with which the moving object is extracted and tracked.
A positive effect is obtained, in which the color of paths of a moving object which are obtained using a method for performing compositing by using higher weights for the moving object is darker than that of paths of the moving object that were obtained using the simple compositing method. However, in the method for performing compositing by using higher weights for the moving object, multiple compositing is performed by using the same weights for portions other, than a background. Accordingly, the larger the number of frame images indicating portions other than the background is, the lower the contribution ratio of one frame image to paths. In such a case, it is difficult to generate paths having a color that is as dark as that of paths indicated in an original image. Furthermore, when a method for determining a background by using the variance of brightness values is used, clear distinction between a background and the other portions is sometimes difficult depending on the states of images. Additionally, when the method for tracking a moving object, which is provided in the related art, is used, paths can be displayed in any manner while data on a moving object is being interpolated. However, in this case, because a region in which the moving object exists, the color of the moving object, the brightness of the moving object, the texture of the moving object, and so forth are used as characteristic values, there is a problem that the method does not deal with changes in the characteristic values, deformation of the moving object, or the like. Moreover, when the number of moving objects is large, there is a problem that it is difficult to track all moving objects in view of cost for calculation or the like.
An image processing apparatus is proposed, which generates a path still image or a path moving image of a moving object by determining a background image in advance, by calculating the dissimilarities between pixel values of the background image and pixel values of input images, and by using the pixel values of the input image for a path-composition image, which is to serve as an output image, in accordance with the dissimilarities (for example, see Japanese Unexamined Patent Application Publication No. 2007-328755 (FIG. 2)).